<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8">
<title>定时器任务管理</title>
<@fm.header />
<style>
.provinceClass label {
	font-size: 12px;
	float:left;
	margin:2px;
	width:80px;
	height:20px;
}
</style>
</head>
<body>
<div class="easyui-layout" style="text-align: center; height: 270px;" fit="true">
	<div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
	<form id="ff" method="post" enctype="multipart/form-data">
        <table>
            <tr>
                <td><label for="sysVerId">系统版本号:</label></td>
                <td colspan="3"><input id="sysVerId" class="easyui-combogrid" style="width: 400px;height: 22px;" name="sysver" data-options="
						panelHeight: '150',
						multiple:true,
						multiline:true,
						url:'/simulator/verList?verType=1',
						method:'get',
						idField: 'ver',
            			textField: 'ver',
            			required:true,
						columns: [[
							{field:'ver',title:'版本号',width:30},
			            ]],
            			fitColumns: true
						"/>
                </td>
            </tr>
            <tr>
				<td><label for="taskType">任务类型</label></td>
				<td>
                    <select class="easyui-combobox" name="taskType" panelHeight="auto" style="width:155px" >
						<option value="1" selected>新增</option>
						<option value="2">留存</option>
					</select>
				</td>
			</tr>
			<tr>
            <td><label for="isOpen">是否启用</label></td>
			<td>
                <select class="easyui-combobox" name="isOpen" panelHeight="auto" style="width:155px" >
					<option value="1" selected>启用</option>
					<option value="0">废弃</option>
				</select>
			</td>

			</tr>

            <tr>
                <td><label for="execTime">执行时间</label></td>
                <td><input type="text" class="easyui-datetimebox" id="execTime" name="execTime" data-options="required:true"></input></td>
            </tr>

        </table>
	</form>
	</div>
	<div region="south" border="false" style="text-align: center; padding: 5px 5px 5px 0;">
	    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="add()">提交</a>
	    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm();">重置</a>
	</div>
</div>

<script>
function add() {
	$('#ff').form(
	    'submit',
	    {
			url : '/taskverTimer/save',
			onSubmit : function() {
				return $(this).form('enableValidation').form('validate');
			},
			success : function(data) {
				showProcess(false);
				var data = eval("(" + data + ")");
				if (data.return_code == '1') {
					top.showMsg(market.content.title, data.return_msg, alert);
					if (parent !== undefined) {
						if ($.isFunction(parent.reloadParent)) {
							parent.reloadParent.call();
							parent.closeMyWindow();
						} else {
							parent.$("#tt").datagrid('reload');
							parent.closeMyWindow();
						}
					}
				}else if(data.return_code == '10'){
					$.messager.alert(market.content.title, data.return_msg);
					if (parent !== undefined) {
						if ($.isFunction(parent.reloadParent)) {
							parent.reloadParent.call();
							parent.closeMyWindow();
						} else {
							parent.$("#tt").datagrid('reload');
							parent.closeMyWindow();
						}
					}
				} else {
					$.messager.alert(market.content.title, data.return_msg);
				}
			},
			onLoadError : function() {
				showProcess(false);
				$.messager.alert(market.content.title, market.content.networkError);
			}
		}); 
}
</script>
</body>
</html>